package org.zoomdev.zoom.dao.adapters.parameter;

import org.zoomdev.zoom.dao.adapters.ParameterAdapter;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.time.Instant;

// Java 8 Instant类型适配器
public class InstantParameterAdapter implements ParameterAdapter<Instant> {

    @Override
    public void setNonnullParameter(PreparedStatement ps, int index, Instant data) throws SQLException {
        ps.setTimestamp(index, Timestamp.from(data));
    }
}
